﻿using Coldairarrow.Entity;
using Coldairarrow.Entity.Base_Manage;
using Coldairarrow.Entity.DTO;
using Coldairarrow.Util;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Coldairarrow.Business.Base_Manage
{
    public partial interface IBase_UserBusiness
    {
        Task<PageResult<Base_UserDTO>> GetDataListAsync(PageInput<Base_UsersInputDTO> input);
        Task<List<UserRole>> GetUserRoleDataListAsync(PageInput<ConditionDTO> input);
        Task<PageResult<Base_UserDTO>> GetDataListAsyncUser(PageInput<Base_UsersInputDTO> input);
        Task<PageResult<Base_User>> GetDataListAsyncs(PageInput<ConditionDTO> input);
        Task<List<SelectOption>> GetOptionListAsync(OptionListInputDTO input);
        Task<Base_UserDTO> GetTheDataAsync(string id);
        Task AddDataAsync(UserEditInputDTO input);
        Task UpdateDataAsync(UserEditInputDTO input);
        Task DeleteDataAsync(List<string> ids);
        Task<List<UserTreeDTO>> GetTreeUserListAsyncs();
        Task<List<Base_UserDTO>> SelectUserID(string ID);
        Task<List<UserRoleImage>> GetDataListByDeptuserid(PageInput<ConditionDTO> input);
        Task<List<Base_UserDTO>> SelectUser();
        Task<List<Base_UserDTO>> Selectid(string id);
        Task UpdateImgAsync(Base_User input);
        IQueryable<T> GetQueryable<T>() where T : class, new();
        Task AddUserExlAsync(List<Base_User> list);
        Task AddUserRoleExlAsync(List<Base_UserRole> list);


        Task<Base_UserDTO> GetDataDingUserIdAsyncUser(string DingUserId);
        /// <summary>
        /// 获取班组下今天排班的人员
        /// </summary>
        /// <param name="Deptid"></param>
        /// <param name="dispatchDate"></param>
        /// <returns></returns>
        Task<List<Base_UserItemDTO>> GetItemUserList(string Deptid);

        Task UploadAvatar(UserImgFile Data);
    }

    [Map(typeof(Base_User))]
    public class UserEditInputDTO : Base_User
    {
        public string newPwd { get; set; }
        public List<string> RoleIdList { get; set; }
    }

    public class Base_UsersInputDTO
    {
        public bool all { get; set; }
        public string userId { get; set; }
        public string keyword { get; set; }
        public string Faid { get; set; }

        public string DepartmentId { get; set; }

        public string Roid { get; set; }
    }
}